<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html >
<head>
	<meta charset="UTF-8">
	<title>试用区-后台登录</title>
	<link rel="stylesheet" href="<%=path%>/css/bootstrap/3.3.5/css/bootstrap.min.css" />
	<link rel="stylesheet" href="<%=path%>/css/cz.css" />

	<script src="<%=path%>/js/jquery-1.11.0.min.js"></script>
	<script src="<%=path%>/css/bootstrap/3.3.5/js/bootstrap.min.js"></script>
	<script src="<%=path%>/js/plugins/layer/layer.js"></script>

	<script src="<%=path%>/js/slider.js"></script>
	<script src="<%=path%>/js/common.js"></script>
	<script type="text/javascript">
	var path = "<%=path%>";
	</script>
<body>
<div class="signPage">
	<div class="signFormBox" style="margin-top:-277px; ">
		<form method="post" class="mb30" role="form" action="#">
			<div class="text-center mb30">
				<a href="#">
					<img src="<%=path%>/images/logo.png" width="100"></a>
				<h2 class="title">账号登录</h2>
			</div>
			<div class="form-group">
				<div class="input-group input-group-lg">
					<span class="input-group-addon"> <i class="glyphicon glyphicon-user"></i>
					</span>
					<input class="hidden">
					<input type="text" name="userAccount" id="user_account" class="form-control" placeholder="账号" value=""></div>
			</div>
			<div class="form-group">
				<div class="input-group input-group-lg">
					<span class="input-group-addon"> <i class="glyphicon glyphicon-lock"></i>
					</span>
					<input type="password" name="userPassword"  id="password" class="form-control" placeholder="密码"></div>
			</div>
			<button type="submit" class="btn btn-block btn-primary btn-lg" id="loginbtn" onclick="javascript:doLogin()">登录</button>
		</form>
		<div class="text-center">Powered By in68</div>
		<div class="bg"></div>
	</div>
	<div class="bg" style="background-image:url('<%=path%>/images/loginbg.jpeg')"></div>
</div>
</body>
<script type="text/javascript">
function doLogin(){
	$("#loginbtn").addClass("disabled").attr("disabled","disabled").val("登录中");
	var redirectUrl="${redirectUrl}";
	$.ajax({
		url : path + "/uncheck/doAdminLogin",
		type : "post",
		dataType : "json",
		data : {
			userAccount : $("#user_account").val(),
			userPassword : $("#password").val()
		},
		success : function(data)
		{
			if(data.result)
			{
				if(redirectUrl != ''){
					window.location.href = redirectUrl;
				}else{
					window.location.href = path + "/views/admin/admin_center.jsp";
				}
			}
			else
			{
				layer.msg(data.msg,{icon: 2});
				$("#loginbtn").removeClass("disabled").removeAttr("disabled").val("登录");
			}
		},error:function(){
			layer.msg("服务器网络繁忙",{icon: 2});
			$("#loginbtn").removeClass("disabled").removeAttr("disabled").val("登录");
		}
	});
}
</script>
</html>